import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import VueAxios from 'vue-axios'
import axios from 'axios'
Vue.use(VueAxios, axios);

// 使用前端框架 element-ui https://element.eleme.io/#/zh-CN
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 移动端使用 Vant  https://youzan.github.io/vant/#/zh-CN
import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);

import 'swiper/dist/css/swiper.css'
import VueAwesomeSwiper from 'vue-awesome-swiper'
Vue.use(VueAwesomeSwiper)

import preloadImage from 'vue-preload-image'
Vue.component('preload-image', preloadImage)

// 增加mock数据
// import Mock from './mock'
// Mock.init();

// 引入全局公共样式
import '@/css/app.css'

// 引入翻译
import VueI18n from 'vue-i18n'
Vue.use(VueI18n);
const i18n = new VueI18n({
  locale: 'zh-CN',
  messages: {
    'zh-CN': require('./language/zh'),
    'en-US': require('./language/en'),
  }
});

// 引入全局 directive
import directive from './directive'
Vue.use(directive);

// 引入全局 filter
import filter from './filter'
Vue.use(filter);

Vue.config.productionTip = false;

new Vue({
  i18n,
  router,
  store,
  render: h => h(App)
}).$mount('#app');
